rm(list = ls())

## packages 

library(tidyverse)
library(fixest)

## Load data 

dat <- readRDS('data/civey_clean.rds') %>%
  mutate(crime_rate_county_post = summer_bin*crime_rate_county)

## Control for county level crime rate 

feols(vote_afd ~ treated_post + crime_rate_county_post  | user_id + date, 
            data = dat ,
            fsplit = ~ foreign_non_eu_share_bin, 
            cluster = ~ user_id) %>%
  etable()


